package gui;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.border.TitledBorder;
import javax.swing.JTabbedPane;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;
import javax.swing.JComboBox;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JLabel;
import javax.swing.SwingConstants;
import javax.swing.JTextField;
import javax.swing.JButton;
import javax.swing.UIManager;
import java.awt.Dimension;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.event.MenuKeyListener;
import javax.swing.event.MenuKeyEvent;

public class Sale extends JFrame {

	private JPanel contentPane;
	private JTable table;
	private JTextField textField;
	private JTextField textField_1;
	private JTable table_1;
	private JTextField textField_3;
	private JTextField textField_2;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					Sale frame = new Sale();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public Sale() {
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 800, 600);
		
		JMenuBar menuBar = new JMenuBar();
		setJMenuBar(menuBar);
		
		JMenuItem mntmKunde = new JMenuItem("Kunde");
		menuBar.add(mntmKunde);
		
		JMenuItem mntmSalg = new JMenuItem("Salg");
		mntmSalg.addMenuKeyListener(new MenuKeyListener() {
			public void menuKeyPressed(MenuKeyEvent arg0) {
			}
			public void menuKeyReleased(MenuKeyEvent arg0) {
			}
			public void menuKeyTyped(MenuKeyEvent arg0) {
			}
		});
		mntmSalg.setSelected(true);
		menuBar.add(mntmSalg);
		
		JMenuItem mntmBetaling = new JMenuItem("Betaling");
		menuBar.add(mntmBetaling);
		
		JMenuItem mntmOrdreStatus = new JMenuItem("Ordre Status");
		menuBar.add(mntmOrdreStatus);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JPanel panel = new JPanel();
		panel.setBorder(new TitledBorder(null, "S\u00F8g vare", TitledBorder.LEADING, TitledBorder.TOP, null, null));
		panel.setBounds(26, 11, 322, 202);
		contentPane.add(panel);
		panel.setLayout(null);
		
		JComboBox comboBox = new JComboBox();
		comboBox.setModel(new DefaultComboBoxModel(new String[] {"Produktomr\u00E5de"}));
		comboBox.setBounds(23, 29, 271, 20);
		panel.add(comboBox);
		
		JLabel lblVarenr = new JLabel("Varenr.");
		lblVarenr.setHorizontalAlignment(SwingConstants.RIGHT);
		lblVarenr.setBounds(10, 70, 59, 14);
		panel.add(lblVarenr);
		
		textField = new JTextField();
		textField.setBounds(79, 67, 215, 20);
		panel.add(textField);
		textField.setColumns(10);
		
		JLabel lblVarenavn = new JLabel("Varenavn");
		lblVarenavn.setHorizontalAlignment(SwingConstants.RIGHT);
		lblVarenavn.setBounds(10, 98, 59, 14);
		panel.add(lblVarenavn);
		
		textField_1 = new JTextField();
		textField_1.setColumns(10);
		textField_1.setBounds(79, 95, 215, 20);
		panel.add(textField_1);
		
		JButton btnSg = new JButton("S\u00F8g");
		btnSg.setBounds(205, 146, 89, 23);
		panel.add(btnSg);
		
		JScrollPane scrollPane_1 = new JScrollPane();
		scrollPane_1.setBounds(26, 255, 751, 245);
		contentPane.add(scrollPane_1);
		
		JScrollPane scrollPane = new JScrollPane();
		scrollPane.setViewportBorder(null);
		scrollPane.setPreferredSize(new Dimension(2, 0));
		scrollPane_1.setViewportView(scrollPane);
		
		table = new JTable();
		table.setModel(new DefaultTableModel(
			new Object[][] {
				{null, "34", "Cowboy hat /36", "136", "240", "25"},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
				{null, null, null, null, null, null},
			},
			new String[] {
				"V\u00E6lg", "Vare nummer", "Varenavn", "K\u00F8bspris", "Salgspris", "Lager Status"
			}
		) {
			Class[] columnTypes = new Class[] {
				Boolean.class, Object.class, Object.class, Object.class, Object.class, Object.class
			};
			public Class getColumnClass(int columnIndex) {
				return columnTypes[columnIndex];
			}
		});
		table.getColumnModel().getColumn(0).setPreferredWidth(43);
		table.getColumnModel().getColumn(2).setPreferredWidth(113);
		scrollPane.setViewportView(table);
		
		JPanel panel_1 = new JPanel();
		panel_1.setLayout(null);
		panel_1.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "Ordre", TitledBorder.LEADING, TitledBorder.TOP, null, null));
		panel_1.setBounds(410, 11, 322, 202);
		contentPane.add(panel_1);
		
		JScrollPane scrollPane_2 = new JScrollPane();
		scrollPane_2.setBounds(10, 31, 302, 160);
		panel_1.add(scrollPane_2);
		
		table_1 = new JTable();
		table_1.setModel(new DefaultTableModel(
			new Object[][] {
				{null, null, new Integer(1), null},
				{null, null, new Integer(1), null},
				{null, null, null, null},
				{null, null, null, null},
				{null, null, null, null},
				{null, null, null, null},
				{null, null, null, null},
				{null, null, null, null},
			},
			new String[] {
				"Varenr.", "Varenavn", "Antal", "Stk pris"
			}
		) {
			Class[] columnTypes = new Class[] {
				Object.class, Object.class, Integer.class, Object.class
			};
			public Class getColumnClass(int columnIndex) {
				return columnTypes[columnIndex];
			}
		});
		scrollPane_2.setViewportView(table_1);
		
		textField_3 = new JTextField();
		textField_3.setColumns(10);
		textField_3.setBounds(615, 224, 116, 20);
		contentPane.add(textField_3);
		
		JLabel lblPrisInklMoms = new JLabel("Pris inkl. moms");
		lblPrisInklMoms.setBounds(521, 227, 114, 14);
		contentPane.add(lblPrisInklMoms);
		
		textField_2 = new JTextField();
		textField_2.setColumns(10);
		textField_2.setBounds(395, 224, 116, 20);
		contentPane.add(textField_2);
		
		JLabel lblPrisIalt = new JLabel("Pris ialt");
		lblPrisIalt.setHorizontalAlignment(SwingConstants.RIGHT);
		lblPrisIalt.setBounds(325, 227, 60, 14);
		contentPane.add(lblPrisIalt);
		
		JLabel lblDobeltKlikFor = new JLabel("Dobelt klik for vare oplysninger:");
		lblDobeltKlikFor.setBounds(36, 224, 209, 14);
		contentPane.add(lblDobeltKlikFor);
		
		JButton btnGTilBetaling = new JButton("G\u00E5 til betaling");
		btnGTilBetaling.setBounds(635, 528, 122, 23);
		contentPane.add(btnGTilBetaling);
	}
}
